using System;
using System.Collections.Generic;
using System.Text;

namespace testApp
{
    public partial class Win32 
    {
        // R1000 Register Map
        /******************************************************************************/
        /* REGISTER NAME/ADDRESS CONSTANTS                                            */
        /******************************************************************************/
        const ushort MAC_VER = 0x0000;
        const ushort MAC_INFO = 0x0001;
        const ushort MAC_RFTRANSINFO = 0x0002;
        const ushort MAC_DBG1 = 0x0003;
        const ushort MAC_DBG2 = 0x0004;
        const ushort MAC_ERROR = 0x0005;
        const ushort HST_ENGTST_ARG0 = 0x0100;
        const ushort HST_ENGTST_ARG1 = 0x0101;
        const ushort HST_DBG1 = 0x0102;
        const ushort HST_EMU = 0x0103;
        const ushort HST_TEST_RFPOWER = 0x0114;
        const ushort HST_PWRMGMT = 0x0200;
        const ushort HST_CMNDIAGS = 0x0201;
        const ushort MAC_BLK02RES1 = 0x0202;
        const ushort HST_CTR_GCFG = 0x0203;
        const ushort HST_CTR1_CFG = 0x0204;
        const ushort MAC_CTR1_VAL = 0x0205;
        const ushort HST_CTR2_CFG = 0x0206;
        const ushort MAC_CTR2_VAL = 0x0207;
        const ushort HST_CTR3_CFG = 0x0208;
        const ushort MAC_CTR3_VAL = 0x0209;
        const ushort HST_CTR4_CFG = 0x020A;
        const ushort MAC_CTR4_VAL = 0x020B;
        const ushort HST_PROTSCH_SMIDX = 0x0300;
        const ushort HST_PROTSCH_SMCFG = 0x0301;
        const ushort HST_PROTSCH_FTIME_SEL = 0x0302;
        const ushort HST_PROTSCH_FTIME = 0x0303;
        const ushort HST_PROTSCH_SMCFG_SEL = 0x0304;
        const ushort HST_PROTSCH_TXTIME_SEL = 0x0305;
        const ushort HST_PROTSCH_TXTIME_ON = 0x0306;
        const ushort HST_PROTSCH_TXTIME_OFF = 0x0307;
        const ushort HST_PROTSCH_CYCCFG_SEL = 0x0308;
        const ushort HST_PROTSCH_CYCCFG_DESC_ADJ1 = 0x0309;
        const ushort HST_MBP_ADDR = 0x0400;
        const ushort HST_MBP_DATA = 0x0401;
        const ushort HST_MBP_RFU_0x0402 = 0x0402;
        const ushort HST_MBP_RFU_0x0403 = 0x0403;
        const ushort HST_MBP_RFU_0x0404 = 0x0404;
        const ushort HST_MBP_RFU_0x0405 = 0x0405;
        const ushort HST_MBP_RFU_0x0406 = 0x0406;
        const ushort HST_MBP_RFU_0x0407 = 0x0407;
        const ushort HST_LPROF_SEL = 0x0408;
        const ushort HST_LPROF_ADDR = 0x0409;
        const ushort HST_LPROF_DATA = 0x040A;
        const ushort HST_OEM_ADDR = 0x0500;
        const ushort HST_OEM_DATA = 0x0501;
        const ushort HST_GPIO_INMSK = 0x0600;
        const ushort HST_GPIO_OUTMSK = 0x0601;
        const ushort HST_GPIO_OUTVAL = 0x0602;
        const ushort HST_GPIO_CFG = 0x0603;
        const ushort HST_ANT_CYCLES = 0x0700;
        const ushort HST_ANT_DESC_SEL = 0x0701;
        const ushort HST_ANT_DESC_CFG = 0x0702;
        const ushort MAC_ANT_DESC_STAT = 0x0703;
        const ushort HST_ANT_DESC_PORTDEF = 0x0704;
        const ushort HST_ANT_DESC_DWELL = 0x0705;
        const ushort HST_ANT_DESC_RFPOWER = 0x0706;
        const ushort HST_ANT_DESC_INV_CNT = 0x0707;
        const ushort HST_TAGMSK_DESC_SEL = 0x0800;
        const ushort HST_TAGMSK_DESC_CFG = 0x0801;
        const ushort HST_TAGMSK_BANK = 0x0802;
        const ushort HST_TAGMSK_PTR = 0x0803;
        const ushort HST_TAGMSK_LEN = 0x0804;
        const ushort HST_TAGMSK_0_3 = 0x0805;
        const ushort HST_TAGMSK_4_7 = 0x0806;
        const ushort HST_TAGMSK_8_11 = 0x0807;
        const ushort HST_TAGMSK_12_15 = 0x0808;
        const ushort HST_TAGMSK_16_19 = 0x0809;
        const ushort HST_TAGMSK_20_23 = 0x080A;
        const ushort HST_TAGMSK_24_27 = 0x080B;
        const ushort HST_TAGMSK_28_31 = 0x080C;
        const ushort HST_QUERY_CFG = 0x0900;
        const ushort HST_INV_CFG = 0x0901;
        const ushort HST_INV_SEL = 0x0902;
        const ushort HST_INV_ALG_PARM_0 = 0x0903;
        const ushort HST_INV_ALG_PARM_1 = 0x0904;
        const ushort HST_INV_ALG_PARM_2 = 0x0905;
        const ushort HST_INV_ALG_PARM_3 = 0x0906;
        const ushort HST_INV_RFU_0x0907 = 0x0907;
        const ushort HST_INV_RFU_0x0908 = 0x0908;
        const ushort HST_INV_RFU_0x0909 = 0x0909;
        const ushort HST_INV_RFU_0x090A = 0x090A;
        const ushort HST_INV_RFU_0x090B = 0x090B;
        const ushort HST_INV_RFU_0x090C = 0x090C;
        const ushort HST_INV_RFU_0x090D = 0x090D;
        const ushort HST_INV_RFU_0x090E = 0x090E;
        const ushort HST_INV_RFU_0x090F = 0x090F;
        const ushort HST_INV_EPC_MATCH_SEL = 0x0910;
        const ushort HST_INV_EPC_MATCH_CFG = 0x0911;
        const ushort HST_INV_EPCDAT_0_3 = 0x0912;
        const ushort HST_INV_EPCDAT_4_7 = 0x0913;
        const ushort HST_INV_EPCDAT_8_11 = 0x0914;
        const ushort HST_INV_EPCDAT_12_15 = 0x0915;
        const ushort HST_INV_EPCDAT_16_19 = 0x0916;
        const ushort HST_INV_EPCDAT_20_23 = 0x0917;
        const ushort HST_INV_EPCDAT_24_27 = 0x0918;
        const ushort HST_INV_EPCDAT_28_31 = 0x0919;
        const ushort HST_INV_EPCDAT_32_35 = 0x091A;
        const ushort HST_INV_EPCDAT_36_39 = 0x091B;
        const ushort HST_INV_EPCDAT_40_43 = 0x091C;
        const ushort HST_INV_EPCDAT_44_47 = 0x091D;
        const ushort HST_INV_EPCDAT_48_51 = 0x091E;
        const ushort HST_INV_EPCDAT_52_55 = 0x091F;
        const ushort HST_INV_EPCDAT_56_59 = 0x0920;
        const ushort HST_INV_EPCDAT_60_63 = 0x0921;
        const ushort HST_TAGACC_DESC_SEL = 0x0A00;
        const ushort HST_TAGACC_DESC_CFG = 0x0A01;
        const ushort HST_TAGACC_BANK = 0x0A02;
        const ushort HST_TAGACC_PTR = 0x0A03;
        const ushort HST_TAGACC_CNT = 0x0A04;
        const ushort HST_TAGACC_LOCKCFG = 0x0A05;
        const ushort HST_TAGACC_ACCPWD = 0x0A06;
        const ushort HST_TAGACC_KILLPWD = 0x0A07;
        const ushort HST_TAGWRDAT_SEL = 0x0A08;
        const ushort HST_TAGWRDAT_0 = 0x0A09;
        const ushort HST_TAGWRDAT_1 = 0x0A0A;
        const ushort HST_TAGWRDAT_2 = 0x0A0B;
        const ushort HST_TAGWRDAT_3 = 0x0A0C;
        const ushort HST_TAGWRDAT_4 = 0x0A0D;
        const ushort HST_TAGWRDAT_5 = 0x0A0E;
        const ushort HST_TAGWRDAT_6 = 0x0A0F;
        const ushort HST_TAGWRDAT_7 = 0x0A10;
        const ushort HST_TAGWRDAT_8 = 0x0A11;
        const ushort HST_TAGWRDAT_9 = 0x0A12;
        const ushort HST_TAGWRDAT_10 = 0x0A13;
        const ushort HST_TAGWRDAT_11 = 0x0A14;
        const ushort HST_TAGWRDAT_12 = 0x0A15;
        const ushort HST_TAGWRDAT_13 = 0x0A16;
        const ushort HST_TAGWRDAT_14 = 0x0A17;
        const ushort HST_TAGWRDAT_15 = 0x0A18;
        const ushort MAC_RFTC_PAPWRLEV = 0x0B00;
        const ushort HST_RFTC_PAPWRCTL_PGAIN = 0x0B01;
        const ushort HST_RFTC_PAPWRCTL_IGAIN = 0x0B02;
        const ushort HST_RFTC_PAPWRCTL_DGAIN = 0x0B03;
        const ushort MAC_RFTC_REVPWRLEV = 0x0B04;
        const ushort HST_RFTC_REVPWRTHRSH = 0x0B05;
        const ushort MAC_RFTC_AMBIENTTEMP = 0x0B06;
        const ushort HST_RFTC_AMBIENTTEMPTHRSH = 0x0B07;
        const ushort MAC_RFTC_XCVRTEMP = 0x0B08;
        const ushort HST_RFTC_XCVRTEMPTHRSH = 0x0B09;
        const ushort MAC_RFTC_PATEMP = 0x0B0A;
        const ushort HST_RFTC_PATEMPTHRSH = 0x0B0B;
        const ushort HST_RFTC_PADELTATEMPTHRSH = 0x0B0C;
        const ushort HST_RFTC_PAPWRCTL_AIWDELAY = 0x0B0D;
        const ushort MAC_RFTC_PAPWRCTL_STAT0 = 0x0B0E;
        const ushort MAC_RFTC_PAPWRCTL_STAT1 = 0x0B0F;
        const ushort MAC_RFTC_PAPWRCTL_STAT2 = 0x0B10;
        const ushort MAC_RFTC_PAPWRCTL_STAT3 = 0x0B11;
        const ushort HST_RFTC_ANTSENSRESTHRSH = 0x0B12;
        const ushort HST_RFTC_IFLNAAGCRANGE = 0x0B13;
        const ushort MAC_RFTC_LAST_ANACTRL1 = 0x0B14;
        const ushort HST_RFTC_OPENLOOPPWRCTRL = 0x0B15;
        const ushort HST_RFTC_RFU_0x0B16 = 0x0B16;
        const ushort HST_RFTC_RFU_0x0B17 = 0x0B17;
        const ushort HST_RFTC_RFU_0x0B18 = 0x0B18;
        const ushort HST_RFTC_RFU_0x0B19 = 0x0B19;
        const ushort HST_RFTC_RFU_0x0B1A = 0x0B1A;
        const ushort HST_RFTC_RFU_0x0B1B = 0x0B1B;
        const ushort HST_RFTC_RFU_0x0B1C = 0x0B1C;
        const ushort HST_RFTC_RFU_0x0B1D = 0x0B1D;
        const ushort HST_RFTC_RFU_0x0B1E = 0x0B1E;
        const ushort HST_RFTC_RFU_0x0B1F = 0x0B1F;
        const ushort HST_RFTC_CAL_GGNEG7 = 0x0B20;
        const ushort HST_RFTC_CAL_GGNEG5 = 0x0B21;
        const ushort HST_RFTC_CAL_GGNEG3 = 0x0B22;
        const ushort HST_RFTC_CAL_GGNEG1 = 0x0B23;
        const ushort HST_RFTC_CAL_GGPLUS1 = 0x0B24;
        const ushort HST_RFTC_CAL_GGPLUS3 = 0x0B25;
        const ushort HST_RFTC_CAL_GGPLUS5 = 0x0B26;
        const ushort HST_RFTC_CAL_GGPLUS7 = 0x0B27;
        const ushort HST_RFTC_CAL_MACADCREFV = 0x0B28;
        const ushort HST_RFTC_CAL_RFFWDPWR_C0 = 0x0B29;
        const ushort HST_RFTC_CAL_RFFWDPWR_C1 = 0x0B2A;
        const ushort HST_RFTC_CAL_RFFWDPWR_C2 = 0x0B2B;
        const ushort HST_RFTC_RFU_0x0B2C = 0x0B2C;
        const ushort HST_RFTC_RFU_0x0B2D = 0x0B2D;
        const ushort HST_RFTC_RFU_0x0B2E = 0x0B2E;
        const ushort HST_RFTC_RFU_0x0B2F = 0x0B2F;
        const ushort HST_RFTC_CLKDBLR_CFG = 0x0B30;
        const ushort HST_RFTC_CLKDBLR_SEL = 0x0B31;
        const ushort HST_RFTC_CLKDBLR_LUTENTRY = 0x0B32;
        const ushort HST_RFTC_RFU_0x0B33 = 0x0B33;
        const ushort HST_RFTC_RFU_0x0B34 = 0x0B34;
        const ushort HST_RFTC_RFU_0x0B35 = 0x0B35;
        const ushort HST_RFTC_RFU_0x0B36 = 0x0B36;
        const ushort HST_RFTC_RFU_0x0B37 = 0x0B37;
        const ushort HST_RFTC_RFU_0x0B38 = 0x0B38;
        const ushort HST_RFTC_RFU_0x0B39 = 0x0B39;
        const ushort HST_RFTC_RFU_0x0B3A = 0x0B3A;
        const ushort HST_RFTC_RFU_0x0B3B = 0x0B3B;
        const ushort HST_RFTC_RFU_0x0B3C = 0x0B3C;
        const ushort HST_RFTC_RFU_0x0B3D = 0x0B3D;
        const ushort HST_RFTC_RFU_0x0B3E = 0x0B3E;
        const ushort HST_RFTC_RFU_0x0B3F = 0x0B3F;
        const ushort HST_RFTC_FRQHOPMODE = 0x0B40;
        const ushort HST_RFTC_FRQHOPENTRYCNT = 0x0B41;
        const ushort HST_RFTC_FRQHOPTABLEINDEX = 0x0B42;
        const ushort MAC_RFTC_HOPCNT = 0x0B43;
        const ushort HST_RFTC_MINHOPDUR = 0x0B44;
        const ushort HST_RFTC_MAXHOPDUR = 0x0B45;
        const ushort HST_RFTC_FRQHOPRANDSEED = 0x0B46;
        const ushort MAC_RFTC_FRQHOPSHFTREGVAL = 0x0B47;
        const ushort MAC_RFTC_FRQHOPRANDNUMCNT = 0x0B48;
        const ushort HST_RFTC_FRQCHINDEX = 0x0B49;
        const ushort HST_RFTC_PLLLOCKTIMEOUT = 0x0B4A;
        const ushort HST_RFTC_PLLLOCK_DET_THRSH = 0x0B4B;
        const ushort HST_RFTC_PLLLOCK_DET_CNT = 0x0B4C;
        const ushort HST_RFTC_PLLLOCK_TO = 0x0B4D;
        const ushort HST_RFTC_BERREADDELAY = 0x0B4E;
        const ushort HST_RFTC_RFU_0x0B4F = 0x0B4F;
        const ushort MAC_RFTC_FWDRFPWRRAWADC = 0x0B50;
        const ushort MAC_RFTC_REVRFPWRRAWADC = 0x0B51;
        const ushort MAC_RFTC_ANTSENSERAWADC = 0x0B52;
        const ushort MAC_RFTC_AMBTEMPRAWADC = 0x0B53;
        const ushort MAC_RFTC_PATEMPRAWADC = 0x0B54;
        const ushort MAC_RFTC_XCVRTEMPRAWADC = 0x0B55;
        const ushort HST_RFTC_RFU_0x0B56 = 0x0B56;
        const ushort HST_RFTC_RFU_0x0B57 = 0x0B57;
        const ushort HST_RFTC_RFU_0x0B58 = 0x0B58;
        const ushort HST_RFTC_RFU_0x0B59 = 0x0B59;
        const ushort HST_RFTC_RFU_0x0B5A = 0x0B5A;
        const ushort HST_RFTC_RFU_0x0B5B = 0x0B5B;
        const ushort HST_RFTC_RFU_0x0B5C = 0x0B5C;
        const ushort HST_RFTC_RFU_0x0B5D = 0x0B5D;
        const ushort HST_RFTC_RFU_0x0B5E = 0x0B5E;
        const ushort HST_RFTC_RFU_0x0B5F = 0x0B5F;
        const ushort HST_RFTC_CURRENT_PROFILE = 0x0B60;
        const ushort HST_RFTC_PROF_SEL = 0x0B61;
        const ushort MAC_RFTC_PROF_CFG = 0x0B62;
        const ushort MAC_RFTC_PROF_ID_HIGH = 0x0B63;
        const ushort MAC_RFTC_PROF_ID_LOW = 0x0B64;
        const ushort MAC_RFTC_PROF_IDVER = 0x0B65;
        const ushort MAC_RFTC_PROF_PROTOCOL = 0x0B66;
        const ushort MAC_RFTC_PROF_R2TMODTYPE = 0x0B67;
        const ushort MAC_RFTC_PROF_TARI = 0x0B68;
        const ushort MAC_RFTC_PROF_X = 0x0B69;
        const ushort MAC_RFTC_PROF_PW = 0x0B6A;
        const ushort MAC_RFTC_PROF_RTCAL = 0x0B6B;
        const ushort MAC_RFTC_PROF_TRCAL = 0x0B6C;
        const ushort MAC_RFTC_PROF_DIVIDERATIO = 0x0B6D;
        const ushort MAC_RFTC_PROF_MILLERNUM = 0x0B6E;
        const ushort MAC_RFTC_PROF_T2RLINKFREQ = 0x0B6F;
        const ushort MAC_RFTC_PROF_VART2DELAY = 0x0B70;
        const ushort MAC_RFTC_PROF_RXDELAY = 0x0B71;
        const ushort MAC_RFTC_PROF_MINTOTT2DELAY = 0x0B72;
        const ushort MAC_RFTC_PROF_TXPROPDELAY = 0x0B73;
        const ushort MAC_RFTC_PROF_RSSIAVECFG = 0x0B74;
        const ushort HST_RFTC_RFU_0x0B75 = 0x0B75;
        const ushort HST_RFTC_RFU_0x0B76 = 0x0B76;
        const ushort HST_RFTC_RFU_0x0B77 = 0x0B77;
        const ushort HST_RFTC_RFU_0x0B78 = 0x0B78;
        const ushort HST_RFTC_RFU_0x0B79 = 0x0B79;
        const ushort HST_RFTC_RFU_0x0B7A = 0x0B7A;
        const ushort HST_RFTC_RFU_0x0B7B = 0x0B7B;
        const ushort HST_RFTC_RFU_0x0B7C = 0x0B7C;
        const ushort HST_RFTC_RFU_0x0B7D = 0x0B7D;
        const ushort HST_RFTC_RFU_0x0B7E = 0x0B7E;
        const ushort HST_RFTC_RFU_0x0B7F = 0x0B7F;
        const ushort HST_RFTC_RFU_0x0B80 = 0x0B80;
        const ushort HST_RFTC_RFU_0x0B81 = 0x0B81;
        const ushort HST_RFTC_RFU_0x0B82 = 0x0B82;
        const ushort HST_RFTC_RFU_0x0B83 = 0x0B83;
        const ushort HST_RFTC_RFU_0x0B84 = 0x0B84;
        const ushort HST_RFTC_FRQCH_ENTRYCNT = 0x0C00;
        const ushort HST_RFTC_FRQCH_SEL = 0x0C01;
        const ushort HST_RFTC_FRQCH_CFG = 0x0C02;
        const ushort HST_RFTC_FRQCH_DESC_PLLDIVMULT = 0x0C03;
        const ushort HST_RFTC_FRQCH_DESC_PLLDACCTL = 0x0C04;
        const ushort MAC_RFTC_FRQCH_DESC_PLLLOCKSTAT0 = 0x0C05;
        const ushort MAC_RFTC_FRQCH_DESC_PLLLOCKSTAT1 = 0x0C06;
        const ushort HST_RFTC_FRQCH_DESC_PARFU3 = 0x0C07;
        const ushort HST_RFTC_FRQCH_CMDSTART = 0x0C08;
        const ushort HST_CMD = 0xF000;

        /******************************************************************************/
        /* HOST Command                                                               */
        /******************************************************************************/
        const uint CMD_INVALIDVAL = 0xFFFFFFFF;  /* invalid command value */
        const uint CMD_NONE = 0x00000000;  /* not a command */
        const uint CMD_NV_MEM_UPDATE = 0x00000001;  /* Enter Special Firmware Mode */
        const uint CMD_WROEM = 0x00000002;  /* Write OEM Configuration Area */
        const uint CMD_RDOEM = 0x00000003;  /* Read OEM Configuration Area */
        const uint CMD_ENGTST1 = 0x00000004;  /* Enginering Test Command #1 */
        const uint CMD_MBPRDREG = 0x00000005;  /* MAC by-pass Read Register */
        const uint CMD_MBPWRREG = 0x00000006;  /* Mac by-pass Write Register */
        const uint CMD_CLRCTR = 0x00000007;  /* clear counter */
        const uint CMD_RDCTR = 0x00000008;  /* read counter */
        const uint CMD_ENCTR = 0x00000009;  /* enable counter */
        const uint CMD_MACSNAP = 0x0000000A;  /* Mac Register Snapshot */
        const uint CMD_TILSNAP = 0x0000000B;  /* Tilden Register Snapshot */
        const uint CMD_RDGPIO = 0x0000000C;  /* Read GPIO */
        const uint CMD_WRGPIO = 0x0000000D;  /* Write GPIO */
        const uint CMD_CFGGPIO = 0x0000000E;  /* Configure GPIO */
        const uint CMD_18K6CINV = 0x0000000F;  /* ISO 18000-6C Inventory */
        const uint CMD_18K6CREAD = 0x00000010;  /* ISO 18000-6C Read */
        const uint CMD_18K6CWRITE = 0x00000011;  /* ISO 18000-6C Write */
        const uint CMD_18K6CLOCK = 0x00000012;  /* ISO 18000-6C Lock */
        const uint CMD_18K6CKILL = 0x00000013;  /* ISO 18000-6C Kill */
        const uint CMD_SETPWRMGMTCFG = 0x00000014;  /* Set Power Management Configuration */
        const uint CMD_CLRERR = 0x00000015;  /* Clear Error condition */
        const uint CMD_SHUFFLEHOPTABLE = 0x00000016;  /* Generate a new freq hop table */
        const uint CMD_CWON = 0x00000017;  /* Turn the RF carrier wave on */
        const uint CMD_CWOFF = 0x00000018;  /* Turn the RF carrier wave off */
        const uint CMD_UPDATELINKPROFILE = 0x00000019;  /* Cause the Tilden registers to be overwritten based on a new "profile" selection */
        const uint CMD_SETFHRANDSEED = 0x0000001A;  /* Set the frequency-hopping random seed */
        const uint CMD_CALIBRATE_GG = 0x0000001B;  /* Calibrate gross-gain settings */
        const uint CMD_LPROF_RDXCVRREG = 0x0000001C;  /* Link-profile Read Xcvr Register */
        const uint CMD_LPROF_WRXCVRREG = 0x0000001D;  /* Link-profile Write Xcvr Register */
        const uint CMD_18K6CBLOCKERASE = 0x0000001E;  /* ISO 18000-6C Block Erase */
        const uint CMD_18K6CBLOCKWRITE = 0x0000001F;  /* ISO 18000-6C Block Write */
        const uint CMD_POP_SPURWATABLE = 0x00000020; /* Pull MAC VRegs for spur workaround into local table */
        const uint CMD_POPRFTCSENSLUTS = 0x00000021; /* Populate lookup tables used by RFTC sensor module */

        // R1000 Packet kind
        const ushort RFID_PACKET_TYPE_COMMAND_BEGIN = 0x0000;
        const ushort RFID_PACKET_TYPE_COMMAND_END = 0x0001;
        const ushort RFID_PACKET_TYPE_ANTENNA_CYCLE_BEGIN = 0x0002;
        const ushort RFID_PACKET_TYPE_ANTENNA_BEGIN = 0x0003;
        const ushort RFID_PACKET_TYPE_18K6C_INVENTORY_ROUND_BEGIN = 0x0004;
        const ushort RFID_PACKET_TYPE_18K6C_INVENTORY = 0x0005;
        const ushort RFID_PACKET_TYPE_18K6C_TAG_ACCESS = 0x0006;
        const ushort RFID_PACKET_TYPE_ANTENNA_CYCLE_END = 0x0007;
        const ushort RFID_PACKET_TYPE_ANTENNA_END = 0x0008;
        const ushort RFID_PACKET_TYPE_18K6C_INVENTORY_ROUND_END = 0x0009;
        const ushort RFID_PACKET_TYPE_INVENTORY_CYCLE_BEGIN = 0x000A;
        const ushort RFID_PACKET_TYPE_INVENTORY_CYCLE_END = 0x000B;
        const ushort RFID_PACKET_TYPE_CARRIER_INFO = 0x000C;
        const ushort RFID_PACKET_TYPE_CYCCFG_EVT = 0x000D;
        const ushort RFID_PACKET_TYPE_RES0 = 0x1000;
        const ushort RFID_PACKET_TYPE_RES1 = 0x1001;
        const ushort RFID_PACKET_TYPE_RES2 = 0x1002;
        const ushort RFID_PACKET_TYPE_RES3 = 0x1003;
        const ushort RFID_PACKET_TYPE_18K6C_INVENTORY_ROUND_BEGIN_DIAGS = 0x1004;
        const ushort RFID_PACKET_TYPE_18K6C_INVENTORY_ROUND_END_DIAGS = 0x1005;
        const ushort RFID_PACKET_TYPE_18K6C_INVENTORY_DIAGS = 0x1006;
        const ushort RFID_PACKET_TYPE_RES4 = 0x1007;
        const ushort RFID_PACKET_TYPE_INVENTORY_CYCLE_END_DIAGS = 0x1008;

        const ushort HOST_REG_REQ_ACCESS_READ = 0;
        const ushort HOST_REG_REQ_ACCESS_WRITE = 1;

        const int INVALID_HANDLE_VALUE = -1;
        const int DIGCF_DEFAULT = 0x1;
        const int DIGCF_PRESENT = 0x2;
        const int DIGCF_ALLCLASSES = 0x4;
        const int DIGCF_PROFILE = 0x8;
        const int DIGCF_DEVICEINTERFACE = 0x10;

        const uint GENERIC_READ = 0x80000000;
        const uint GENERIC_WRITE = 0x40000000;
        const uint OPEN_EXISTING = 3;
        const uint FILE_FLAG_OVERLAPPED = 0x40000000;
        const uint FILE_SHARE_READ = 0x00000001;
        const uint FILE_SHARE_WRITE = 0x00000002;

        Guid R1000GUID = new Guid("48C602D4-C77E-45b9-8133-20C9683BD1A6");

        const uint HARVEMAC_IOCTL_INDEX = 0;
        const uint FILE_ANY_ACCESS = 0;
        const uint FILE_DEVICE_UNKNOWN = 0x00000022;
        const uint METHOD_BUFFERED = 0;

        private static uint CTL_CODE(uint DeviceType, uint Function, uint Method, uint Access)
        {
            return ((DeviceType << 16) | (Access << 14) | (Function << 2) | Method);
        }

        static uint IOCTL_HARVEMAC_WRITE = CTL_CODE(FILE_DEVICE_UNKNOWN,
                                                    HARVEMAC_IOCTL_INDEX,
                                                    METHOD_BUFFERED,
                                                    FILE_ANY_ACCESS);

        static uint IOCTL_HARVEMAC_READ = CTL_CODE(FILE_DEVICE_UNKNOWN,
                                                   HARVEMAC_IOCTL_INDEX + 1,
                                                   METHOD_BUFFERED,
                                                   FILE_ANY_ACCESS);

        static uint IOCTL_HARVEMAC_READ_CNT = CTL_CODE(FILE_DEVICE_UNKNOWN,
                                             HARVEMAC_IOCTL_INDEX + 2,
                                             METHOD_BUFFERED,
                                             FILE_ANY_ACCESS);

        static uint IOCTL_HARVEMAC_CANCEL = CTL_CODE(FILE_DEVICE_UNKNOWN,
                                             HARVEMAC_IOCTL_INDEX + 3,
                                             METHOD_BUFFERED,
                                             FILE_ANY_ACCESS);

        static uint IOCTL_HARVEMAC_SOFTRESET = CTL_CODE(FILE_DEVICE_UNKNOWN,
                                             HARVEMAC_IOCTL_INDEX + 4,
                                             METHOD_BUFFERED,
                                             FILE_ANY_ACCESS);

        static uint IOCTL_HARVEMAC_ABORT = CTL_CODE(FILE_DEVICE_UNKNOWN,
                                             HARVEMAC_IOCTL_INDEX + 5,
                                             METHOD_BUFFERED,
                                             FILE_ANY_ACCESS);
    }
}
